import 'dart:io';

import 'package:flutter/cupertino.dart';

/// @author: pengboboer
/// @createDate: 2022/1/7
///滑动取消蓝色拖拽效果
class RemoveBlueScrollConfiguration extends StatelessWidget {
  final Widget child;

  const RemoveBlueScrollConfiguration({Key? key, required this.child})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ScrollConfiguration(
        behavior: RemoveBlueScrollBehavior(), child: child);
  }
}

class RemoveBlueScrollBehavior extends ScrollBehavior {
  @override
  Widget buildViewportChrome(
          BuildContext context, Widget child, AxisDirection axisDirection) =>
      Platform.isAndroid
          ? child
          : super.buildViewportChrome(context, child, axisDirection);
}
